﻿Ext.define('app.prm.detail.North', {
    extend: 'Ext.panel.Panel',
    region: 'north',
    split: false,
    border: true,
    projectId: 0,
    referenceHolder: true,
    tbar: [],
    bodyStyle: 'padding:5px',
    initComponent: function () {
        var me = this;
        me.items = [
            new Ext.layout.container.Container({
                anchor: '100%',
                border: false,
                style: 'margin:10px 0 10px 0',
                height: 20,
                layout: 'border',
                items: [
                {
                    xtype: 'progressbar',
                    region: 'center',
                    bind: {
                        //text: '{formatPlanProgress}',
                        value: '{planProgress}'
                    }
                },
                new Ext.panel.Panel(
                {
                    border: false,
                    region: 'east',
                    width: 280,
                    bodyStyle: 'padding:0 0 0 10px',
                    bind: {
                        html: localize('PlanStart') + ' - ' + localize('PlanEnd') + '：{planStartDate} - {planEndDate}'
                    }
                })]
            })
            //,
            //new Ext.layout.container.Container({
            //    anchor: '100%',
            //    height: 20,
            //    border:false,
            //    layout: 'border',
            //    items: [
            //    {
            //        xtype: 'progressbar',
            //        region: 'center',
            //        bind: {
            //            //text: '{formatPlanProgress}',
            //            value: '{actualProgress}'
            //        }
            //    },
            //    {
            //        border: false,
            //        region: 'east',
            //        width: 280,
            //        bodyStyle: 'padding:0 0 0 10px',
            //        bind: {
            //            html: localize('ActualStart') + ' - ' + localize('RequiredComplete') + '：{actualStartDate} - {actualEndDate}'
            //        }
            //    }
            //    ]
            //})
        ];
        me.tbar = [
            {
                xtype: 'tbtext',
                bind: {
                    text: '<b>{projectName}({projectNo} / {productNo})</b>'
                }
            },
            {
                text: localize('Follower'),
                bind: {
                    hidden: '{hasFollowered}'
                },
                handler: 'onFollowProject'
            },
            {
                text: localize('UnFollower'),
                bind: {
                    hidden: '{!hasFollowered}'
                },
                handler: 'onUnFollowProject'
            },
            '-',
             {
                 text: '',
                 reference: 'abInquiryBtn',
                 bind: {
                     text: '询盘({inquiryCount})',
                     hidden: '{hideAbInquiryBtn}'
                 },
                 handler: 'onAbInquirys'
             },
            "->",
            //{
            //    text: localize('BasicInfo'),
            //    bind: {
            //        hidden: '{!hasEditInfo}'
            //    },
            //    handler: 'onEditInfo'
            //},
             {
                 text: '项目进度表',
                 bind: {
                     hidden: '{!hasPlan}'
                 },
                 handler: 'onCMOProgress'
             },
             {
                 text: localize('ProjectPlan'),
                 bind: {
                     hidden: '{!hasPlan}'
                 },
                 handler: 'onOpenPlan'
             },
            {
                text: localize('ProjectDocument'),
                bind: {
                    hidden: '{!hasDocument}'
                },
                handler: 'onOpenDocument'
            },
            //{
            //    text: '成员评价', handler: 'onTeamComment'
            //},
            //{
            //    text: '项目评价', handler: function () {
            //        var win = Ext.create("app.prm.detail.PrmEvaluation");
            //        win.show();
            //    }
            //},
            {
                text: localize('ProjectTopic'),
                bind: {
                    hidden: '{!hasTopic}'
                },
                handler: 'onDiscuss'
            },
            {
                text: '工艺路线',
                bind: {
                    hidden: '{!hasSynthView}'
                },
                handler: 'onOpenSynth'
            }
        ];
        me.callParent();
    }
})